// import { reject, resolve } from "core-js/fn/promise";
import axios from "./index";
// 引入axios


// 普通函数写 get
// this.axios.get('url',{data:params})
export function get(url,params){
    return new Promise((resolve,reject)=>{
        axios.get(url,{
            data:params
        }).then(res=>{
            resolve(res)
        }).catch(err=>{
            reject(err)
        })
    })
}

// 封装delete
export function deletes(url,params){
    return new Promise((resolve,reject)=>{
        axios.delete(url,{
            data:params
        }).then(res=>{
            resolve(res)
        }).catch(err=>{
            reject(err)
        })
    })
}


// 箭头函数  post
export let  post=(url,params)=>{
    return new Promise((resolve,reject)=>{
        axios.post(url,params)
        .then(res=>{
            resolve(res)
        }).catch(err=>{
            reject(err)
        })
    })
}